package com.cium.aqie.myClass

/**
 * @Function:
 * @Author: aqie
 * @Date: 2019/8/27 11:41
 */
class Girl constructor(nature: String, look: String, voice: String): People(nature, look, voice){
    // 默认 public
    var age:Int = 18

    var hobbby:String = ""

    public get(){
        return field
    }
    set(hobby){
        println("set hobby")
        field = hobby
    }

    // var name:String by Delegates.notNull()
    lateinit var name:String

    // 懒加载一个val类型的类成员变量
    val dress:Clothes by lazy {
        println("init clothes")
        Clothes()
    }

    // 可以为null 并初始化
    var education:String? = null

    // 复写get方法  和 lateinit 冲突
    /*get() {
        println("get girl age")
        return field
    }*/

    fun getInfo(): String {
        return "Girl $age"
    }

    fun sing(song : String){
        println("$age year girl sing $song")
    }
}